﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%
	dim nid,tilte,hr,we0,we,sou,dao,zi,zi0,body,dat,dat1,pl
        nid=Request.querystring("nid")
	if nid="" then nid=qingtian.nid 
	if not isnumeric(nid) then nid=qingtian.nid
	nid=clng(nid)
        id=Request.querystring("id")
	if id="" then id=1
	if not isnumeric(id) then id=1
	id=clng(id)

if nid=qingtian.nid then
tilte="发表评论"
else
tilte="发表出错"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id FROM qingtian_user where id="&nid,conn,1,1
if rs.eof then
  Response.Redirect "login.asp?v=" & v & "&fv=" & fv & "&url=space.asp?sid="&sidd&"@@urls="&urls
end if
  rs.close
  set rs=Nothing
end if
select case v
case "0"
we0="<br/>"
%>
<card title="<%=tilte%>"><p align="<%=qingtian.px%>">
<%
case "1"
hr="<hr>"
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
%>
<title><%=tilte%></title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%
End Select
%>
<%
		if sid<>"Null" then
		qingtian.info
		end if
response.write we
pl=request.form("pl")
if pl="" then
  response.write("评论内容不能为空！<br/>")
elseif len(pl)>300 then
  response.write("评论字数不能大于300字！<br/>")
else
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from qingtian_photopl",conn,1,2
rs.addnew
rs("photopl")=pl
rs("pluser")=session("username")
rs("userid")=qingtian.nid
rs("photoid")=id
rs("times")=now()
rs.update
response.write("评论发表成功！<br/>")
rs.close
Set rs=nothing
dim photoCount
	photoCount=conn.execute("Select count(ID) from [qingtian_photopl] where photoid="&id&"")(0)	
conn.execute("update qingtian_upfile Set photoCount = "&clng(photoCount)&" where id="&id)
conn.close
set conn=nothing
	response.write("<a href=""photobbs.asp?id="&id&"&amp;nid="&nid&"&amp;sid="&sidd&""">查看评论</a><br/>")
	response.write("<a href=""photoview.asp?id="&id&"&amp;nid="&nid&"&amp;sid="&sidd&""">查看相片</a>"&we0&"")
end if
%>
<%=sou%><a href='p.asp?sid=<%=sidd%>'>返回社区相册</a><%=we0%>
 
<%
End Function
%>
